package com.ocom.exposeapi.feign;

import com.ocom.common.constant.PayHandleUrl;
import com.ocom.common.dto.TimerPaymentCallBackDto;
import com.ocom.common.entity.card.EntityXfRecordProcess;
import com.ocom.common.request.payhandle.*;
import com.ocom.common.resp.RespMachMessage;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.ccb.CcbzhshAddUserVo;
import com.ocom.common.vo.pay.ABCChargeConfirmVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;
import java.util.Map;


@FeignClient(value = "payhandle")
public interface PayHandleClientService {

    @PostMapping(PayHandleUrl.URL_InsertEntityXfRecord)
    public Result InsertEntityXfRecord(@RequestBody EntityXfRecordProcess entityXfRecordProcess);

    @PostMapping(PayHandleUrl.URL_abcChargeConfirm)
    public Result abcChargeConfirm(@RequestBody ABCChargeConfirmVo vo);

    @PostMapping(PayHandleUrl.URL_abcChargeFail)
    public Result abcChargeFail(@RequestParam("comId") Long comId, @RequestParam("orderNo")String orderNo);

    @PostMapping(PayHandleUrl.getZkzlPay)
    public Result zkzlPay(@RequestBody ZkzlPayRequest request);

    @PostMapping(PayHandleUrl.getZkzlTimer)
    public void zkzlTimerPaymentCallBack(TimerPaymentCallBackDto dto);

    @PostMapping(PayHandleUrl.URL_getComWhiteList)
    public Result getComWhiteList(@RequestParam("companyId") Long companyId, @RequestParam("personVer")Integer personVer, @RequestParam("listLimi")Integer listLimi);

    @PostMapping(PayHandleUrl.URL_getRecordByOrderno)
    public Result getRecordByOrderno(@RequestBody GetRecordByOrderNoRequest request);

    //余额查询
    @PostMapping(value = PayHandleUrl.URL_getBalance)
    public RespMachMessage getBalance(@Valid @RequestBody Map<String, Object> map);

    //在线卡消费
    @PostMapping(PayHandleUrl.getPayCard)
    public Result getPayCard(@RequestBody QrCardPayRequest request);

    @PostMapping(PayHandleUrl.URL_PayHandle_feeRefund)
    Result feeRefund(@RequestBody FeeRefundRequest request);


    @PostMapping(PayHandleUrl.URL_ccbzhshAddUser)
    Result ccbzhshAddUser(@RequestBody @Valid CcbzhshAddUserVo request);

    @PostMapping(PayHandleUrl.URL_ccbzhshDeleteUser)
    Result URL_ccbzhshDeleteUser(@RequestBody @Valid CcbzhshAddUserVo request);

    @PostMapping(PayHandleUrl.URL_sendByOrderno)
    public Result sendByOrderno(@RequestBody EntityXfRecordProcess request);

    /**
     * 付款码退款
     */
    @PostMapping(PayHandleUrl.URL_PayHandle_qrCodeRefund)
    public Result qrCodeRefund(@RequestBody QrCodeRefundRequest request);

    /**
     * 在线订单查询
     */
    @PostMapping(PayHandleUrl.URL_OnlinePayQuery)
    public Result onlinePayQuery(@Valid @RequestBody QrCodeQueryRequest request);

}
